package com.loyal.loyalerp.system.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.loyal.loyalerp.system.mapper.GySystemMapper;
import com.loyal.loyalerp.system.model.GySystem;
import com.loyal.loyalerp.system.service.SystemService;
@Service
public class SystemServiceImpl implements SystemService {
	@Autowired
	GySystemMapper gySystemMapper;
	@Override
	public PageInfo<GySystem> listGySystem(Integer PageNum, Integer recordNum, String sord, String sidx) {
		Page<GySystem> page = PageHelper.startPage(PageNum, recordNum);
		gySystemMapper.listGySystem(sidx,sord);
		PageInfo<GySystem> pageInfo = new PageInfo<GySystem>(page);
		return pageInfo;
	}

	@Override
	public PageInfo<GySystem> findGySystem(Integer PageNum, Integer recordNum, String sord, String searchField,
			String searchString) {
		Page<GySystem> page = PageHelper.startPage(PageNum, recordNum);
		List<GySystem> list = gySystemMapper.findGySystem(searchField, searchString);
		PageInfo<GySystem> pageInfo = new PageInfo<>(page);
		return pageInfo;
	}
	
}
